package com.nulldev.util.graphics.renderIt.api.core;

import com.nulldev.util.graphics.renderIt.api.renderItGraphicsInterface;
import com.nulldev.util.graphics.renderIt.api.envcaps.renderItOperations;

public interface IRenderCallback {
	public default void onRender(final renderItGraphicsInterface iface) {
		this.onRender(iface, IRenderCallbackMetadata.DEFAULT);
	}

	public void onRender(final renderItGraphicsInterface iface, final IRenderCallbackMetadata metadata);

	public default void onClose(final renderItGraphicsInterface iface) {
		if (iface == null)
			throw new NullPointerException("iface == null!");
		if (iface.supportsOperations(renderItOperations.RIT_RIO_closable))
			iface.closeOperations();
	}
}
